package com.glsc.ngateway.common.base.repo.mysql.gateway.oaflow;

import com.glsc.ngateway.common.base.domain.mysql.gateway.oaflow.TOaFlowMessageTable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface TOaFlowMessageTableRepository extends JpaRepository<TOaFlowMessageTable, Long> {

    /**
     * @param workFlowId
     * @param requestId
     * @return
     */
    @Query(value = "select m from TOaFlowMessageTable m where m.workFlowId = :workFlowId and m.requestId = :requestId")
    List<TOaFlowMessageTable> getMessageByRequestId(String workFlowId, String requestId);
}
